#define ll long long
#define db double
#define pall pair<long long, long long>
#define mll map<long long, long long>
#define sll set<long long>
#define sdb set<double>
#define vll vector<long long>
#define vdb vector<double>

#define ub upper_bound
#define lb lower_bound

#include <bits/甩头dc++.h>

using namespace std;

ll prime[11000000], primesize, phi[10000006];

bool isprime[10000006];

void getlist(int listsize)
{
    memset(isprime, 1, sizeof(isprime));
    isprime[1] = false;
    for (int i = 2; i <= listsize; i++)
    {
        if (isprime[i])
            prime[++primesize] = i;
        for (int j = 1; j <= primesize && i * prime[j] <= listsize; j++)
        {
            isprime[i * prime[j]] = false;
            if (i % prime[j] == 0)
                break;
        }
    }
}

int main()
{

    ll T;
    cin >> T;
    getlist(10000005);

    while (T--)
    {

        ll a;

        cin >> a;

        ll b;

        ll m = 0;

        if (a == 0)
        {
            printf("1\n");
            printf("0 = 0\n");
            continue;
        }

        if (a == 1)
        {
            printf("1\n");
            printf("1 = 1\n");
            continue;
        }

        if (a == 2)
        {
            printf("1\n");
            printf("2 = 2\n");
            continue;
        }
        b = a;
        if (a % 2 == 1)
        {
            if (isprime[a])
            {
                printf("1\n");
                printf("%lld = %lld\n", a, a);
                continue;
            }
            if (isprime[a - 2])
            {
                printf("2\n");
                printf("2 + %lld = %lld\n", a - 2, a);
                continue;
            }
            else
            {
                m++;
                b = a - 1;
            }
        }

        for (ll i = 0;; i++)
        {
            if (isprime[b - prime[i]])
            {
                m += 2;
                printf("%lld\n", m);
                if (a % 2 == 1)
                {
                    m += 1;
                    printf("1 + ");
                }
                printf("%lld + %lld = %lld\n", prime[i], b - prime[i], a);
                break;
            }
        }
    }
}